#include "linkedlist.h"

int main(void)
{
  /* 初始化链表 */
  Node *n0 = new_node(1);
  Node *n1 = new_node(3);
  Node *n2 = new_node(2);
  Node *n3 = new_node(5);
  Node *n4 = new_node(4);
  n0->next = n1;
  n1->next = n2;
  n2->next = n3;
  n3->next = n4;
  print_linked_list(n0);

  /* 插入节点 */
  Node *p = new_node(0);
  insert_node(n0, p);
  print_linked_list(n0);

  /* 删除节点 */
  remove_node(n0);
  print_linked_list(n0);

  /* 访问节点 */
  printf("0: %d\n", access_node(n0, 0)->value);
  printf("4: %d\n", access_node(n0, 4)->value);

  /* 查找节点*/
  printf("\n%d\n", find_node(n0, 4));
  return 0;
}
